home *** CD-ROM | disk | FTP | other *** search
/ AI Game Programming Wisdom / AIGameProgrammingWisdom.iso / SourceCode / 02 Useful Techniques / 08 Zarozinski / src / ffllapi / FuzzyOutSet.h < prev    next >
Encoding:
C/C++ Source or Header  |  2001-12-01  |  2.3 KB  |  73 lines

  1. //
  2. // File:    FuzzyOutSet.h
  3. //
  4. // Purpose:    This is the base class for the output sets.   
  5. //
  6. // Copyright ⌐ 1999-2001 Louder Than A Bomb! Software
  7. //
  8. // This file is part of the FFLL (Free Fuzzy Logic Library) project (http://ffll.sourceforge.net)
  9. // It is released under the BSD license, see http://ffll.sourceforge.net/license.txt for the full text.
  10. //
  11.  
  12. #if !defined(AFX_FUZZYOUTSET_H__C20D825A_5D54_4AE9_8412_5AE3DD0D721F__INCLUDED_)
  13. #define AFX_FUZZYOUTSET_H__C20D825A_5D54_4AE9_8412_5AE3DD0D721F__INCLUDED_
  14.  
  15. #include "FuzzySetBase.h"
  16. class DefuzzSetObj;
  17. class FuzzyOutVariable;
  18.  
  19. // 
  20. // Class:    FuzzyOutSet
  21. //
  22. // This class is for the sets in the output variable. It contain a pointer
  23. // to the DefuzzSetObj abstract class. DefuzzSetObj handles all the calcuations
  24. // needed for the defuzzification process.
  25. //
  26. class FFLL_API FuzzyOutSet : virtual public FuzzySetBase   
  27. {
  28.  
  29.     ////////////////////////////////////////
  30.     ////////// Member Functions ////////////
  31.     ////////////////////////////////////////
  32.  
  33.     public:
  34.  
  35.         FuzzyOutSet(FuzzyVariableBase* par) ;
  36.         virtual ~FuzzyOutSet();
  37.  
  38.         // get functions
  39.         DefuzzSetObj* get_defuzz_obj() const;
  40.         RealType get_defuzz_x(int dom = -1);
  41.          FuzzyOutVariable* get_parent() const;
  42.  
  43.         // set functions
  44.         int set_defuzz_method(int type);
  45.  
  46.     private:
  47.  
  48.         void calc();
  49.  
  50.     ////////////////////////////////////////
  51.     ////////// Class Variables /////////////
  52.     ////////////////////////////////////////
  53.  
  54.     protected:
  55.  
  56.         DefuzzSetObj* defuzz_obj;    // this array holds the Defuzification object.  Right now
  57.                                     // we're only doing COG so it's hardcoded but later we
  58.                                     // can just use a common ancestor and have whatever method is
  59.                                     // appropriate in here.
  60.                                     // This is just a look up table and is done purely for speed
  61.                                     // it will be slower while building the model cuz this array will have
  62.                                     // to be recalculated every time an anchor/handle is moved but that
  63.                                     // only happens when the output var is moved and we're MUCH more
  64.                                     // concerned with the speed at run-time not at design time.
  65.  
  66. }; // end class FuzzyOutSet
  67.  
  68. #else
  69.  
  70. class FuzzyOutSet; // already defined
  71.  
  72. #endif // !defined(AFX_FUZZYOUTSET_H__C20D825A_5D54_4AE9_8412_5AE3DD0D721F__INCLUDED_)
  73.